feat(review): add horizontal code-column scrolling#171
Conversation
Keep gutters and review chrome fixed while letting long diff lines be inspected without switching to wrapped mode. Add arrow-key controls, help text, and targeted coverage for the new reveal path.
Greptile SummaryThis PR prototypes shared horizontal code-column scrolling for the diff review stream. Left/right arrow keys update a single Key changes:
Confidence Score: 5/5Safe to merge — both remaining findings are P2 style suggestions with no correctness or crash risk Prop threading is complete through all render layers, the memo comparator is correctly extended, left/right key handling respects menu-open precedence, and the feature is gated off in wrap mode. Integration and renderer unit tests provide solid coverage of the new behavior. Both flagged items are minor UX polish concerns. src/ui/App.tsx lines 42–44 (tab-width assumption) and lines 240–250 (over-scroll bound) Important Files Changed
Sequence DiagramsequenceDiagram
actor User
participant KB as useAppKeyboardShortcuts
participant App
participant DP as DiffPane
participant DS as DiffSection
participant PDV as PierreDiffView
participant DRV as DiffRowView
participant RIS as renderInlineSpans
User->>KB: left/right arrow key
KB->>App: scrollCodeHorizontally(+/-1)
App->>App: guard: wrapLines=false AND maxCodeHorizontalOffset > 0
App->>App: setCodeHorizontalOffset(clamp(current+/-1, 0, max))
App->>DP: codeHorizontalOffset prop
DP->>DS: codeHorizontalOffset prop
DS->>PDV: codeHorizontalOffset prop
PDV->>DRV: codeHorizontalOffset prop
DRV->>RIS: horizontalOffset arg
RIS->>RIS: sliceSpansWindow(spans, offset, width)
Reviews (1): Last reviewed commit: "feat(review): prototype horizontal code-..." | Re-trigger Greptile |
Make long diff lines easier to inspect by supporting faster shift-arrow movement and shift-wheel code scrolling. Reset the horizontal offset when wrapping toggles so the reveal state stays predictable.
Clamp horizontal reveal to the visible code viewport and share the renderer's tab-expansion math so long lines stop overscrolling into blank space. Preserve vertical position for shift-wheel scrolling and add PTY coverage for real-terminal horizontal reveal and wrap reset behavior.
Summary
Testing